<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆页面</title>
</head>
<body>
<form action="/test/login" method="post" >
    <table >
        <tr>
            <td>用户名:</td>
            <td><input type="text" name="username"></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input type="text" name="password"></td>
        </tr>
        <tr>
            <td><input type="text" name="code" placeholder="请输入验证码"></td>
            <td><img id="cap" onclick="refresh()" src="/captcha" style="width:100px" ></td>
        </tr>
        <tr>
            <td colspan="2"> <input type="submit" value="登录"></td>
        </tr>
    </table>
</form>

</body>
<script type="text/javascript">
    function refresh(){
        var cat = document.getElementById("cap");
        cat.src = "/captcha?"+new Date();
    }
</script>
</html>